package com.grandtech.insurance.common.oss;

public class AliOssConstant {

    public static String filedir = "mobile/";

    public static String endpoint = "";
    public static String bucketName = "";
    public static String accessKeyId = "";
    public static String accessKeySecret = "lm9mo4aBFhzjvP8CejjEP3d7HPEi9n";

    // gykj aliyun 正式
    public static String endpoint_prod = "https://oss-cn-zhangjiakou.aliyuncs.com";
    public static String bucketName_prod = "ram-nydb-test";
    public static String accessKeyId_prod = "LTAIP816Jan0Nvjq";
    public static String accessKeySecret_prod = "lm9mo4aBFhzjvP8CejjEP3d7HPEi9n";

    // gykj aliyun 测试
    public static String endpoint_test = "https://oss-cn-zhangjiakou.aliyuncs.com";
    public static String bucketName_test = "ram-nydb-test";
    public static String accessKeyId_test = "LTAIP816Jan0Nvjq";
    public static String accessKeySecret_test = "lm9mo4aBFhzjvP8CejjEP3d7HPEi9n";

    public void envConfig(String envText) {
        try {
            if (envText.equals("prod")) {
                prodConfig();
            } else if (envText.equals("test")) {
                testConfig();
            } else {
                testConfig();
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public void testConfig() {
        try {
            endpoint = endpoint_test;
            bucketName = bucketName_test;
            accessKeyId = accessKeyId_test;
            accessKeySecret = accessKeySecret_test;
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public void prodConfig() {
        try {
            endpoint = endpoint_prod;
            bucketName = bucketName_prod;
            accessKeyId = accessKeyId_prod;
            accessKeySecret = accessKeySecret_prod;
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
